.MODEL small
.586
EXTRN lirent:proc, ecrent:proc
EXTRN ecrbool:proc
EXTRN ecrch:proc, ligsuiv:proc
.CODE

max:

enter 3,0

push word ptr [bp+0]

pop ax
mov [bp+-4],ax

push word ptr [bp+-4]

push word ptr [bp+2]

pop ax
pop bx
cmp bx,ax
mov ax,sf
not ax
mov bx,zf
not bx
and bx,ax
push word ptr ax

pop ax
cmp ax,0 
je autr1

push word ptr [bp+-4]

pop ax
mov [bp+8],ax

jmp max

jmp fsi1

autr1:

push word ptr [bp+2]

pop ax
mov [bp+8],ax

jmp max

fsi1:

fmax:

ret 2
leave

min:

enter 0,0

push word ptr [bp+0]

push word ptr [bp+2]

pop ax
pop bx
cmp bx,ax
mov ax,zf
not ax
and sf,ax
push word ptr ax

pop ax
cmp ax,0 
je autr2

push word ptr [bp+0]

pop ax
mov [bp+8],ax

jmp min

jmp fsi2

autr2:

push word ptr [bp+2]

pop ax
mov [bp+8],ax

jmp min

fsi2:

fmin:

ret 2
leave

superieur:

enter 0,0

push word ptr [bp+0]

push word ptr [bp+2]

pop ax
pop bx
cmp bx,ax
mov ax,sf
not ax
mov bx,zf
not bx
and bx,ax
push word ptr ax

pop ax
mov [bp+8],ax

jmp superieur

fsuperieur:

ret 2
leave

debut:
STARTUPCODE

enter 4,0

push word ptr 5

pop ax
mov [bp+0],ax

lea dx,[bp+-2]
push word ptr dx
call lirent

call ligsuiv

push word ptr [bp+0]

push word ptr [bp+-2]

push word ptr 5

call min

call max

push word ptr 2

pop ax
mov [bp+-4],ax

push word ptr 1

push word ptr [bp+0]

push word ptr [bp+-2]

push word ptr 5

call max

push word ptr [bp+0]

push word ptr 2

push word ptr [bp+-2]

call min

call superieur

pop ax
mov [bp+-6],ax

call ligsuiv

push word ptr [bp+-4]

call ecrent

call ligsuiv

push word ptr [bp+-6]

call ecrbool

fprinc:

EXITCODE
end debut
